﻿function onUpdating(d,g) {
    // get the update progress div
    var pnlPopup = $get(d);

    //  get the gridview element
    var gridView = $get(g);
    

    // make it visible
    pnlPopup.style.display = '';

    // get the bounds of both the gridview and the progress div
    var gridViewBounds = Sys.UI.DomElement.getBounds(gridView);
    var pnlPopupBounds = Sys.UI.DomElement.getBounds(pnlPopup);

    //  center of gridview
    var x = gridViewBounds.x + Math.round(gridViewBounds.width / 2) - Math.round(pnlPopupBounds.width / 2);
    var y = gridViewBounds.y + Math.round(gridViewBounds.height / 2) - Math.round(pnlPopupBounds.height / 2);

    //	set the progress element to this position
    Sys.UI.DomElement.setLocation(pnlPopup, x, y);

    // diable gridview
    //    $find(g).get_masterTableView().disabled = 'disabled';
//    gridView.disabled = true;
}

function onUpdated(d) {
    // get the update progress div
    var pnlPopup = $get(d);
    // make it invisible
    pnlPopup.style.display = 'none';
}  